from selenium import webdriver

path = 'chromedriver.exe'

browser = webdriver.Chrome(path)

url = 'http://www.baidu.com'

browser.get(url=url)

# find_element_by_id
# button = browser.find_element_by_id('su')

# find_element_by_name  标签属性的名字
# n = browser.find_elements_by_name('wd')[0]
# print(n)

# n_list = browser.find_elements_by_tag_name('input')
# print(n_list)

# find_elements_by_xpath
# n = browser.find_elements_by_xpath('//input[@id="su"]')
# print(n)

# find_elements_by_css_selector
# n = browser.find_elements_by_css_selector('#su')

# find_elements_by_link_text('')
t = browser.find_elements_by_link_text('hao123')
print(t)

browser.quit()